package org.ghost.jetty.demo;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler;
import org.ghost.jetty.demo.servlet.HelloServlet;

/**
 * @author Administrator
 */
public class Application {
    public static void main(String[] args) throws Exception {
        Server server = new Server(8080);

        // 添加servlet处理器
        ServletHandler servletHandler = new ServletHandler();
        server.setHandler(servletHandler);

        // 添加具体的servlet
        servletHandler.addServletWithMapping(HelloServlet.class, "/hello");

        server.start();
        server.join();
    }
}
